package be.gnx.fogo.application.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.hibernate.Transaction;

import be.gnx.fogo.application.dao.CountryDao;
import be.gnx.fogo.application.util.HibernateUtil;

public class Country {

  private ISO_3166_1_alpha2 iso_3166_1_alpha2;

  private int iso_3166_1_numeric;
  
  private int phoneCode;

  private String label;

  public static void initialise() {
    /* data coming from
     *          http://en.wikipedia.org/wiki/ISO_3166-1
     *          http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
     *          http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
     */
    CountryDao countryDao = new CountryDao();
    Transaction transaction = HibernateUtil.beginTransaction();
    List<Country> list = countryDao.getAll();
    HashMap<ISO_3166_1_alpha2, Country> countriesHashMap = new HashMap<ISO_3166_1_alpha2, Country>();
    for (Country country : list) {
      countriesHashMap.put(country.iso_3166_1_alpha2, country);
    }

    final List<Country> initialCountries = new ArrayList<Country>(); {
      initialCountries.add(new Country("ad__andorra__country", 20, ISO_3166_1_alpha2.AD, 0));
      initialCountries.add(new Country("ae__united_arab_emirates__country", 784, ISO_3166_1_alpha2.AE, 0));
      initialCountries.add(new Country("af__afghanistan__country", 4, ISO_3166_1_alpha2.AF, 0));
      initialCountries.add(new Country("ag__antigua_and_barbuda__country", 28, ISO_3166_1_alpha2.AG, 0));
      initialCountries.add(new Country("ai__anguilla__country", 660, ISO_3166_1_alpha2.AI, 0));
      initialCountries.add(new Country("al__albania__country", 8, ISO_3166_1_alpha2.AL, 0));
      initialCountries.add(new Country("am__armenia__country", 51, ISO_3166_1_alpha2.AM, 0));
      initialCountries.add(new Country("an__netherlands_antilles__country", 530, ISO_3166_1_alpha2.AN, 0));
      initialCountries.add(new Country("ao__angola__country", 24, ISO_3166_1_alpha2.AO, 0));
      initialCountries.add(new Country("aq__antarctica__country", 10, ISO_3166_1_alpha2.AQ, 0));
      initialCountries.add(new Country("ar__argentina__country", 32, ISO_3166_1_alpha2.AR, 0));
      initialCountries.add(new Country("as__american_samoa__country", 16, ISO_3166_1_alpha2.AS, 0));
      initialCountries.add(new Country("at__austria__country", 40, ISO_3166_1_alpha2.AT, 0));
      initialCountries.add(new Country("au__australia__country", 36, ISO_3166_1_alpha2.AU, 0));
      initialCountries.add(new Country("aw__aruba__country", 533, ISO_3166_1_alpha2.AW, 0));
      initialCountries.add(new Country("ax__aland_islands__country", 248, ISO_3166_1_alpha2.AX, 0));
      initialCountries.add(new Country("az__azerbaijan__country", 31, ISO_3166_1_alpha2.AZ, 0));
      initialCountries.add(new Country("ba__bosnia_and_herzegovina__country", 70, ISO_3166_1_alpha2.BA, 0));
      initialCountries.add(new Country("bb__barbados__country", 52, ISO_3166_1_alpha2.BB, 0));
      initialCountries.add(new Country("bd__bangladesh__country", 50, ISO_3166_1_alpha2.BD, 0));
      initialCountries.add(new Country("be__belgium__country", 56, ISO_3166_1_alpha2.BE, 32));
      initialCountries.add(new Country("bf__burkina_faso__country", 854, ISO_3166_1_alpha2.BF, 0));
      initialCountries.add(new Country("bg__bulgaria__country", 100, ISO_3166_1_alpha2.BG, 0));
      initialCountries.add(new Country("bh__bahrain__country", 48, ISO_3166_1_alpha2.BH, 0));
      initialCountries.add(new Country("bi__burundi__country", 108, ISO_3166_1_alpha2.BI, 0));
      initialCountries.add(new Country("bj__benin__country", 204, ISO_3166_1_alpha2.BJ, 0));
      initialCountries.add(new Country("bl__saint_barthelemy__country", 652, ISO_3166_1_alpha2.BL, 0));
      initialCountries.add(new Country("bm__bermuda__country", 60, ISO_3166_1_alpha2.BM, 0));
      initialCountries.add(new Country("bn__brunei_darussalam__country", 96, ISO_3166_1_alpha2.BN, 0));
      initialCountries.add(new Country("bo__bolivia__country", 68, ISO_3166_1_alpha2.BO, 0));
      initialCountries.add(new Country("br__brazil__country", 76, ISO_3166_1_alpha2.BR, 0));
      initialCountries.add(new Country("bs__bahamas__country", 44, ISO_3166_1_alpha2.BS, 0));
      initialCountries.add(new Country("bt__bhutan__country", 64, ISO_3166_1_alpha2.BT, 0));
      initialCountries.add(new Country("bv__bouvet_island__country", 74, ISO_3166_1_alpha2.BV, 0));
      initialCountries.add(new Country("bw__botswana__country", 72, ISO_3166_1_alpha2.BW, 0));
      initialCountries.add(new Country("by__belarus__country", 112, ISO_3166_1_alpha2.BY, 0));
      initialCountries.add(new Country("bz__belize__country", 84, ISO_3166_1_alpha2.BZ, 0));
      initialCountries.add(new Country("ca__canada__country", 124, ISO_3166_1_alpha2.CA, 0));
      initialCountries.add(new Country("cc__cocos_keeling_islands__country", 166, ISO_3166_1_alpha2.CC, 0));
      initialCountries.add(new Country("cd__congo_the_democratic_republic_of_the__country", 180, ISO_3166_1_alpha2.CD, 0));
      initialCountries.add(new Country("cf__central_african_republic__country", 140, ISO_3166_1_alpha2.CF, 0));
      initialCountries.add(new Country("cg__congo__country", 178, ISO_3166_1_alpha2.CG, 0));
      initialCountries.add(new Country("ch__switzerland__country", 756, ISO_3166_1_alpha2.CH, 0));
      initialCountries.add(new Country("ci__cote_d_ivoire__country", 384, ISO_3166_1_alpha2.CI, 0));
      initialCountries.add(new Country("ck__cook_islands__country", 184, ISO_3166_1_alpha2.CK, 0));
      initialCountries.add(new Country("cl__chile__country", 152, ISO_3166_1_alpha2.CL, 0));
      initialCountries.add(new Country("cm__cameroon__country", 120, ISO_3166_1_alpha2.CM, 0));
      initialCountries.add(new Country("cn__china__country", 156, ISO_3166_1_alpha2.CN, 0));
      initialCountries.add(new Country("co__colombia__country", 170, ISO_3166_1_alpha2.CO, 0));
      initialCountries.add(new Country("cr__costa_rica__country", 188, ISO_3166_1_alpha2.CR, 0));
      initialCountries.add(new Country("cu__cuba__country", 192, ISO_3166_1_alpha2.CU, 0));
      initialCountries.add(new Country("cv__cape_verde__country", 132, ISO_3166_1_alpha2.CV, 0));
      initialCountries.add(new Country("cx__christmas_island__country", 162, ISO_3166_1_alpha2.CX, 0));
      initialCountries.add(new Country("cy__cyprus__country", 196, ISO_3166_1_alpha2.CY, 0));
      initialCountries.add(new Country("cz__czech_republic__country", 203, ISO_3166_1_alpha2.CZ, 0));
      initialCountries.add(new Country("de__germany__country", 276, ISO_3166_1_alpha2.DE, 0));
      initialCountries.add(new Country("dj__djibouti__country", 262, ISO_3166_1_alpha2.DJ, 0));
      initialCountries.add(new Country("dk__denmark__country", 208, ISO_3166_1_alpha2.DK, 0));
      initialCountries.add(new Country("dm__dominica__country", 212, ISO_3166_1_alpha2.DM, 0));
      initialCountries.add(new Country("do__dominican_republic__country", 214, ISO_3166_1_alpha2.DO, 0));
      initialCountries.add(new Country("dz__algeria__country", 12, ISO_3166_1_alpha2.DZ, 0));
      initialCountries.add(new Country("ec__ecuador__country", 218, ISO_3166_1_alpha2.EC, 0));
      initialCountries.add(new Country("ee__estonia__country", 233, ISO_3166_1_alpha2.EE, 0));
      initialCountries.add(new Country("eg__egypt__country", 818, ISO_3166_1_alpha2.EG, 0));
      initialCountries.add(new Country("eh__western_sahara__country", 732, ISO_3166_1_alpha2.EH, 0));
      initialCountries.add(new Country("er__eritrea__country", 232, ISO_3166_1_alpha2.ER, 0));
      initialCountries.add(new Country("es__spain__country", 724, ISO_3166_1_alpha2.ES, 0));
      initialCountries.add(new Country("et__ethiopia__country", 231, ISO_3166_1_alpha2.ET, 0));
      initialCountries.add(new Country("fi__finland__country", 246, ISO_3166_1_alpha2.FI, 0));
      initialCountries.add(new Country("fj__fiji__country", 242, ISO_3166_1_alpha2.FJ, 0));
      initialCountries.add(new Country("fk__falkland_islands_malvinas__country", 238, ISO_3166_1_alpha2.FK, 0));
      initialCountries.add(new Country("fm__micronesia_federated_states_of__country", 583, ISO_3166_1_alpha2.FM, 0));
      initialCountries.add(new Country("fo__faroe_islands__country", 234, ISO_3166_1_alpha2.FO, 0));
      initialCountries.add(new Country("fr__france__country", 250, ISO_3166_1_alpha2.FR, 0));
      initialCountries.add(new Country("ga__gabon__country", 266, ISO_3166_1_alpha2.GA, 0));
      initialCountries.add(new Country("gb__united_kingdom__country", 826, ISO_3166_1_alpha2.GB, 0));
      initialCountries.add(new Country("gd__grenada__country", 308, ISO_3166_1_alpha2.GD, 0));
      initialCountries.add(new Country("ge__georgia__country", 268, ISO_3166_1_alpha2.GE, 0));
      initialCountries.add(new Country("gf__french_guiana__country", 254, ISO_3166_1_alpha2.GF, 0));
      initialCountries.add(new Country("gg__guernsey__country", 831, ISO_3166_1_alpha2.GG, 0));
      initialCountries.add(new Country("gh__ghana__country", 288, ISO_3166_1_alpha2.GH, 0));
      initialCountries.add(new Country("gi__gibraltar__country", 292, ISO_3166_1_alpha2.GI, 0));
      initialCountries.add(new Country("gl__greenland__country", 304, ISO_3166_1_alpha2.GL, 0));
      initialCountries.add(new Country("gm__gambia__country", 270, ISO_3166_1_alpha2.GM, 0));
      initialCountries.add(new Country("gn__guinea__country", 324, ISO_3166_1_alpha2.GN, 0));
      initialCountries.add(new Country("gp__guadeloupe__country", 312, ISO_3166_1_alpha2.GP, 0));
      initialCountries.add(new Country("gq__equatorial_guinea__country", 226, ISO_3166_1_alpha2.GQ, 0));
      initialCountries.add(new Country("gr__greece__country", 300, ISO_3166_1_alpha2.GR, 0));
      initialCountries.add(new Country("gs__south_georgia_and_the_south_sandwich_islands__country", 239, ISO_3166_1_alpha2.GS, 0));
      initialCountries.add(new Country("gt__guatemala__country", 320, ISO_3166_1_alpha2.GT, 0));
      initialCountries.add(new Country("gu__guam__country", 316, ISO_3166_1_alpha2.GU, 0));
      initialCountries.add(new Country("gw__guinea-bissau__country", 624, ISO_3166_1_alpha2.GW, 0));
      initialCountries.add(new Country("gy__guyana__country", 328, ISO_3166_1_alpha2.GY, 0));
      initialCountries.add(new Country("hk__hong_kong__country", 344, ISO_3166_1_alpha2.HK, 0));
      initialCountries.add(new Country("hm__heard_island_and_mcdonald_islands__country", 334, ISO_3166_1_alpha2.HM, 0));
      initialCountries.add(new Country("hn__honduras__country", 340, ISO_3166_1_alpha2.HN, 0));
      initialCountries.add(new Country("hr__croatia__country", 191, ISO_3166_1_alpha2.HR, 0));
      initialCountries.add(new Country("ht__haiti__country", 332, ISO_3166_1_alpha2.HT, 0));
      initialCountries.add(new Country("hu__hungary__country", 348, ISO_3166_1_alpha2.HU, 0));
      initialCountries.add(new Country("id__indonesia__country", 360, ISO_3166_1_alpha2.ID, 0));
      initialCountries.add(new Country("ie__ireland__country", 372, ISO_3166_1_alpha2.IE, 0));
      initialCountries.add(new Country("il__israel__country", 376, ISO_3166_1_alpha2.IL, 0));
      initialCountries.add(new Country("im__isle_of_man__country", 833, ISO_3166_1_alpha2.IM, 0));
      initialCountries.add(new Country("in__india__country", 356, ISO_3166_1_alpha2.IN, 0));
      initialCountries.add(new Country("io__british_indian_ocean_territory__country", 86, ISO_3166_1_alpha2.IO, 0));
      initialCountries.add(new Country("iq__iraq__country", 368, ISO_3166_1_alpha2.IQ, 0));
      initialCountries.add(new Country("ir__iran_islamic_republic_of__country", 364, ISO_3166_1_alpha2.IR, 0));
      initialCountries.add(new Country("is__iceland__country", 352, ISO_3166_1_alpha2.IS, 0));
      initialCountries.add(new Country("it__italy__country", 380, ISO_3166_1_alpha2.IT, 0));
      initialCountries.add(new Country("je__jersey__country", 832, ISO_3166_1_alpha2.JE, 0));
      initialCountries.add(new Country("jm__jamaica__country", 388, ISO_3166_1_alpha2.JM, 0));
      initialCountries.add(new Country("jo__jordan__country", 400, ISO_3166_1_alpha2.JO, 0));
      initialCountries.add(new Country("jp__japan__country", 392, ISO_3166_1_alpha2.JP, 0));
      initialCountries.add(new Country("ke__kenya__country", 404, ISO_3166_1_alpha2.KE, 0));
      initialCountries.add(new Country("kg__kyrgyzstan__country", 417, ISO_3166_1_alpha2.KG, 0));
      initialCountries.add(new Country("kh__cambodia__country", 116, ISO_3166_1_alpha2.KH, 0));
      initialCountries.add(new Country("ki__kiribati__country", 296, ISO_3166_1_alpha2.KI, 0));
      initialCountries.add(new Country("km__comoros__country", 174, ISO_3166_1_alpha2.KM, 0));
      initialCountries.add(new Country("kn__saint_kitts_and_nevis__country", 659, ISO_3166_1_alpha2.KN, 0));
      initialCountries.add(new Country("kp__korea_democratic_people_s_republic_of__country", 408, ISO_3166_1_alpha2.KP, 0));
      initialCountries.add(new Country("kr__korea_republic_of__country", 410, ISO_3166_1_alpha2.KR, 0));
      initialCountries.add(new Country("kw__kuwait__country", 414, ISO_3166_1_alpha2.KW, 0));
      initialCountries.add(new Country("ky__cayman_islands__country", 136, ISO_3166_1_alpha2.KY, 0));
      initialCountries.add(new Country("kz__kazakhstan__country", 398, ISO_3166_1_alpha2.KZ, 0));
      initialCountries.add(new Country("la__lao_people_s_democratic_republic__country", 418, ISO_3166_1_alpha2.LA, 0));
      initialCountries.add(new Country("lb__lebanon__country", 422, ISO_3166_1_alpha2.LB, 0));
      initialCountries.add(new Country("lc__saint_lucia__country", 662, ISO_3166_1_alpha2.LC, 0));
      initialCountries.add(new Country("li__liechtenstein__country", 438, ISO_3166_1_alpha2.LI, 0));
      initialCountries.add(new Country("lk__sri_lanka__country", 144, ISO_3166_1_alpha2.LK, 0));
      initialCountries.add(new Country("lr__liberia__country", 430, ISO_3166_1_alpha2.LR, 0));
      initialCountries.add(new Country("ls__lesotho__country", 426, ISO_3166_1_alpha2.LS, 0));
      initialCountries.add(new Country("lt__lithuania__country", 440, ISO_3166_1_alpha2.LT, 0));
      initialCountries.add(new Country("lu__luxembourg__country", 442, ISO_3166_1_alpha2.LU, 0));
      initialCountries.add(new Country("lv__latvia__country", 428, ISO_3166_1_alpha2.LV, 0));
      initialCountries.add(new Country("ly__libyan_arab_jamahiriya__country", 434, ISO_3166_1_alpha2.LY, 0));
      initialCountries.add(new Country("ma__morocco__country", 504, ISO_3166_1_alpha2.MA, 0));
      initialCountries.add(new Country("mc__monaco__country", 492, ISO_3166_1_alpha2.MC, 0));
      initialCountries.add(new Country("md__moldova,_republic_of__country", 498, ISO_3166_1_alpha2.MD, 0));
      initialCountries.add(new Country("me__montenegro__country", 499, ISO_3166_1_alpha2.ME, 0));
      initialCountries.add(new Country("mf__saint_martin_french_part__country", 663, ISO_3166_1_alpha2.MF, 0));
      initialCountries.add(new Country("mg__madagascar__country", 450, ISO_3166_1_alpha2.MG, 0));
      initialCountries.add(new Country("mh__marshall_islands__country", 584, ISO_3166_1_alpha2.MH, 0));
      initialCountries.add(new Country("mk__macedonia,_the_former_yugoslav_republic_of__country", 807, ISO_3166_1_alpha2.MK, 0));
      initialCountries.add(new Country("ml__mali__country", 466, ISO_3166_1_alpha2.ML, 0));
      initialCountries.add(new Country("mm__myanmar__country", 104, ISO_3166_1_alpha2.MM, 0));
      initialCountries.add(new Country("mn__mongolia__country", 496, ISO_3166_1_alpha2.MN, 0));
      initialCountries.add(new Country("mo__macao__country", 446, ISO_3166_1_alpha2.MO, 0));
      initialCountries.add(new Country("mp__northern_mariana_islands__country", 580, ISO_3166_1_alpha2.MP, 0));
      initialCountries.add(new Country("mq__martinique__country", 474, ISO_3166_1_alpha2.MQ, 0));
      initialCountries.add(new Country("mr__mauritania__country", 478, ISO_3166_1_alpha2.MR, 0));
      initialCountries.add(new Country("ms__montserrat__country", 500, ISO_3166_1_alpha2.MS, 0));
      initialCountries.add(new Country("mt__malta__country", 470, ISO_3166_1_alpha2.MT, 0));
      initialCountries.add(new Country("mu__mauritius__country", 480, ISO_3166_1_alpha2.MU, 0));
      initialCountries.add(new Country("mv__maldives__country", 462, ISO_3166_1_alpha2.MV, 0));
      initialCountries.add(new Country("mw__malawi__country", 454, ISO_3166_1_alpha2.MW, 0));
      initialCountries.add(new Country("mx__mexico__country", 484, ISO_3166_1_alpha2.MX, 0));
      initialCountries.add(new Country("my__malaysia__country", 458, ISO_3166_1_alpha2.MY, 0));
      initialCountries.add(new Country("mz__mozambique__country", 508, ISO_3166_1_alpha2.MZ, 0));
      initialCountries.add(new Country("na__namibia__country", 516, ISO_3166_1_alpha2.NA, 0));
      initialCountries.add(new Country("nc__new_caledonia__country", 540, ISO_3166_1_alpha2.NC, 0));
      initialCountries.add(new Country("ne__niger__country", 562, ISO_3166_1_alpha2.NE, 0));
      initialCountries.add(new Country("nf__norfolk_island__country", 574, ISO_3166_1_alpha2.NF, 0));
      initialCountries.add(new Country("ng__nigeria__country", 566, ISO_3166_1_alpha2.NG, 0));
      initialCountries.add(new Country("ni__nicaragua__country", 558, ISO_3166_1_alpha2.NI, 0));
      initialCountries.add(new Country("nl__netherlands__country", 528, ISO_3166_1_alpha2.NL, 0));
      initialCountries.add(new Country("no__norway__country", 578, ISO_3166_1_alpha2.NO, 0));
      initialCountries.add(new Country("np__nepal__country", 524, ISO_3166_1_alpha2.NP, 0));
      initialCountries.add(new Country("nr__nauru__country", 520, ISO_3166_1_alpha2.NR, 0));
      initialCountries.add(new Country("nu__niue__country", 570, ISO_3166_1_alpha2.NU, 0));
      initialCountries.add(new Country("nz__new_zealand__country", 554, ISO_3166_1_alpha2.NZ, 0));
      initialCountries.add(new Country("om__oman__country", 512, ISO_3166_1_alpha2.OM, 0));
      initialCountries.add(new Country("pa__panama__country", 591, ISO_3166_1_alpha2.PA, 0));
      initialCountries.add(new Country("pe__peru__country", 604, ISO_3166_1_alpha2.PE, 0));
      initialCountries.add(new Country("pf__french_polynesia__country", 258, ISO_3166_1_alpha2.PF, 0));
      initialCountries.add(new Country("pg__papua_new_guinea__country", 598, ISO_3166_1_alpha2.PG, 0));
      initialCountries.add(new Country("ph__philippines__country", 608, ISO_3166_1_alpha2.PH, 0));
      initialCountries.add(new Country("pk__pakistan__country", 586, ISO_3166_1_alpha2.PK, 0));
      initialCountries.add(new Country("pl__poland__country", 616, ISO_3166_1_alpha2.PL, 0));
      initialCountries.add(new Country("pm__saint_pierre_and_miquelon__country", 666, ISO_3166_1_alpha2.PM, 0));
      initialCountries.add(new Country("pn__pitcairn__country", 612, ISO_3166_1_alpha2.PN, 0));
      initialCountries.add(new Country("pr__puerto_rico__country", 630, ISO_3166_1_alpha2.PR, 0));
      initialCountries.add(new Country("ps__palestinian_territory,_occupied__country", 275, ISO_3166_1_alpha2.PS, 0));
      initialCountries.add(new Country("pt__portugal__country", 620, ISO_3166_1_alpha2.PT, 0));
      initialCountries.add(new Country("pw__palau__country", 585, ISO_3166_1_alpha2.PW, 0));
      initialCountries.add(new Country("py__paraguay__country", 600, ISO_3166_1_alpha2.PY, 0));
      initialCountries.add(new Country("qa__qatar__country", 634, ISO_3166_1_alpha2.QA, 0));
      initialCountries.add(new Country("re__reunion__country", 638, ISO_3166_1_alpha2.RE, 0));
      initialCountries.add(new Country("ro__romania__country", 642, ISO_3166_1_alpha2.RO, 0));
      initialCountries.add(new Country("rs__serbia__country", 688, ISO_3166_1_alpha2.RS, 0));
      initialCountries.add(new Country("ru__russian_federation__country", 643, ISO_3166_1_alpha2.RU, 0));
      initialCountries.add(new Country("rw__rwanda__country", 646, ISO_3166_1_alpha2.RW, 0));
      initialCountries.add(new Country("sa__saudi_arabia__country", 682, ISO_3166_1_alpha2.SA, 0));
      initialCountries.add(new Country("sb__solomon_islands__country", 90, ISO_3166_1_alpha2.SB, 0));
      initialCountries.add(new Country("sc__seychelles__country", 690, ISO_3166_1_alpha2.SC, 0));
      initialCountries.add(new Country("sd__sudan__country", 736, ISO_3166_1_alpha2.SD, 0));
      initialCountries.add(new Country("se__sweden__country", 752, ISO_3166_1_alpha2.SE, 0));
      initialCountries.add(new Country("sg__singapore__country", 702, ISO_3166_1_alpha2.SG, 0));
      initialCountries.add(new Country("sh__saint_helena__country", 654, ISO_3166_1_alpha2.SH, 0));
      initialCountries.add(new Country("si__slovenia__country", 705, ISO_3166_1_alpha2.SI, 0));
      initialCountries.add(new Country("sj__svalbard_and_jan_mayen__country", 744, ISO_3166_1_alpha2.SJ, 0));
      initialCountries.add(new Country("sk__slovakia__country", 703, ISO_3166_1_alpha2.SK, 0));
      initialCountries.add(new Country("sl__sierra_leone__country", 694, ISO_3166_1_alpha2.SL, 0));
      initialCountries.add(new Country("sm__san_marino__country", 674, ISO_3166_1_alpha2.SM, 0));
      initialCountries.add(new Country("sn__senegal__country", 686, ISO_3166_1_alpha2.SN, 0));
      initialCountries.add(new Country("so__somalia__country", 706, ISO_3166_1_alpha2.SO, 0));
      initialCountries.add(new Country("sr__suriname__country", 740, ISO_3166_1_alpha2.SR, 0));
      initialCountries.add(new Country("st__sao_tome_and_principe__country", 678, ISO_3166_1_alpha2.ST, 0));
      initialCountries.add(new Country("sv__el_salvador__country", 222, ISO_3166_1_alpha2.SV, 0));
      initialCountries.add(new Country("sy__syrian_arab_republic__country", 760, ISO_3166_1_alpha2.SY, 0));
      initialCountries.add(new Country("sz__swaziland__country", 748, ISO_3166_1_alpha2.SZ, 0));
      initialCountries.add(new Country("tc__turks_and_caicos_islands__country", 796, ISO_3166_1_alpha2.TC, 0));
      initialCountries.add(new Country("td__chad__country", 148, ISO_3166_1_alpha2.TD, 0));
      initialCountries.add(new Country("tf__french_southern_territories__country", 260, ISO_3166_1_alpha2.TF, 0));
      initialCountries.add(new Country("tg__togo__country", 768, ISO_3166_1_alpha2.TG, 0));
      initialCountries.add(new Country("th__thailand__country", 764, ISO_3166_1_alpha2.TH, 0));
      initialCountries.add(new Country("tj__tajikistan__country", 762, ISO_3166_1_alpha2.TJ, 0));
      initialCountries.add(new Country("tk__tokelau__country", 772, ISO_3166_1_alpha2.TK, 0));
      initialCountries.add(new Country("tl__timor_leste__country", 626, ISO_3166_1_alpha2.TL, 0));
      initialCountries.add(new Country("tm__turkmenistan__country", 795, ISO_3166_1_alpha2.TM, 0));
      initialCountries.add(new Country("tn__tunisia__country", 788, ISO_3166_1_alpha2.TN, 0));
      initialCountries.add(new Country("to__tonga__country", 776, ISO_3166_1_alpha2.TO, 0));
      initialCountries.add(new Country("tr__turkey__country", 792, ISO_3166_1_alpha2.TR, 0));
      initialCountries.add(new Country("tt__trinidad_and_tobago__country", 780, ISO_3166_1_alpha2.TT, 0));
      initialCountries.add(new Country("tv__tuvalu__country", 798, ISO_3166_1_alpha2.TV, 0));
      initialCountries.add(new Country("tw__taiwan_province_of_china__country", 158, ISO_3166_1_alpha2.TW, 0));
      initialCountries.add(new Country("tz__tanzania_united_republic_of__country", 834, ISO_3166_1_alpha2.TZ, 0));
      initialCountries.add(new Country("ua__ukraine__country", 804, ISO_3166_1_alpha2.UA, 0));
      initialCountries.add(new Country("ug__uganda__country", 800, ISO_3166_1_alpha2.UG, 0));
      initialCountries.add(new Country("um__united_states_minor_outlying_islands__country", 581, ISO_3166_1_alpha2.UM, 0));
      initialCountries.add(new Country("us__united_states__country", 840, ISO_3166_1_alpha2.US, 0));
      initialCountries.add(new Country("uy__uruguay__country", 858, ISO_3166_1_alpha2.UY, 0));
      initialCountries.add(new Country("uz__uzbekistan__country", 860, ISO_3166_1_alpha2.UZ, 0));
      initialCountries.add(new Country("va__holy_see_vatican_city_state__country", 336, ISO_3166_1_alpha2.VA, 0));
      initialCountries.add(new Country("vc__saint_vincent_and_the_grenadines__country", 670, ISO_3166_1_alpha2.VC, 0));
      initialCountries.add(new Country("ve__venezuela__country", 862, ISO_3166_1_alpha2.VE, 0));
      initialCountries.add(new Country("vg__virgin_islands_british__country", 92, ISO_3166_1_alpha2.VG, 0));
      initialCountries.add(new Country("vi__virgin_islands_u_s__country", 850, ISO_3166_1_alpha2.VI, 0));
      initialCountries.add(new Country("vn__viet_nam__country", 704, ISO_3166_1_alpha2.VN, 0));
      initialCountries.add(new Country("vu__vanuatu__country", 548, ISO_3166_1_alpha2.VU, 0));
      initialCountries.add(new Country("wf__wallis_and_futuna__country", 876, ISO_3166_1_alpha2.WF, 0));
      initialCountries.add(new Country("ws__samoa__country", 882, ISO_3166_1_alpha2.WS, 0));
      initialCountries.add(new Country("ye__yemen__country", 887, ISO_3166_1_alpha2.YE, 0));
      initialCountries.add(new Country("yt__mayotte__country", 175, ISO_3166_1_alpha2.YT, 0));
      initialCountries.add(new Country("za__south_africa__country", 710, ISO_3166_1_alpha2.ZA, 0));
      initialCountries.add(new Country("zm__zambia__country", 894, ISO_3166_1_alpha2.ZM, 0));
      initialCountries.add(new Country("zw__zimbabwe__country", 716, ISO_3166_1_alpha2.ZW, 0));
      initialCountries.add(new Country("zz__unkown__country", 1, ISO_3166_1_alpha2.ZZ, 0));
      }
    for (Country country : initialCountries) {
      if (!countriesHashMap.containsKey(country.iso_3166_1_alpha2)) {
        countryDao.save(country);
      }
    }
    transaction.commit();
  }

  public Country() {
    
  }

  private Country(String label, int iso_3166_1_numeric, ISO_3166_1_alpha2 iso_3166_1_alpha2, int phoneCode) {
    this.label = label;
    this.iso_3166_1_numeric = iso_3166_1_numeric;
    this.iso_3166_1_alpha2 = iso_3166_1_alpha2;
    this.phoneCode = phoneCode;
  }

  public String getLabel() {
    return label;
  }

  public void setLabel(String label) {
    this.label = label;
  }

  public int getIso_3166_1_numeric() {
    return iso_3166_1_numeric;
  }

  public void setIso_3166_1_numeric(int iso_3166_1_numeric) {
    this.iso_3166_1_numeric = iso_3166_1_numeric;
  }

  public ISO_3166_1_alpha2 getIso_3166_1_alpha2() {
    return iso_3166_1_alpha2;
  }

  public void setIso_3166_1_alpha2(ISO_3166_1_alpha2 iso_3166_1_alpha2) {
    this.iso_3166_1_alpha2 = iso_3166_1_alpha2;
  }

  public String getIso_3166_1_alpha2_as_string() {
    return iso_3166_1_alpha2.getAlpha2();
  }

  public void setIso_3166_1_alpha2_as_string(String iso_3166_1_alpha2) {
    this.iso_3166_1_alpha2 = ISO_3166_1_alpha2.typeOf(iso_3166_1_alpha2);
  }

  public int getPhoneCode() {
    return phoneCode;
  }

  public void setPhoneCode(int phoneCode) {
    this.phoneCode = phoneCode;
  }

}
